package com.sgl.gk.controller;

import com.sgl.common.annotation.Log;
import com.sgl.common.core.domain.AjaxResult;
import com.sgl.common.enums.BusinessType;
import com.sgl.gk.domain.GkStationTypeEvent;
import com.sgl.gk.mapper.GkStationTypeEventMapper;
import com.sgl.gk.service.GkStationTypeEventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

/**
 * @author:xec
 * @date:2022/10/31 18:50
 *
 * 工位类型事件的controller
 **/
@RestController
@RequestMapping("/gk/stationtypeevent")
public class GkStationTypeEventController {

    @Autowired
    GkStationTypeEventService gkStationTypeEventService;

    /**
     * 查询工位类型事件
     * @param gkStationTypeEvent  查询条件
     * @return 查询返回值
     */
    @GetMapping("/list")
    @ResponseBody
    public AjaxResult list(GkStationTypeEvent gkStationTypeEvent){
        return gkStationTypeEventService.list(gkStationTypeEvent);
    }

    /**
     * 添加工位类型事件
     * @param gkStationTypeEvents 添加信息
     * @return
     */
    @PostMapping("/add")
    @ResponseBody
    @Log(title = "工位类型事件",businessType = BusinessType.INSERT)
    public AjaxResult add(@RequestBody GkStationTypeEvent gkStationTypeEvents){
        return gkStationTypeEventService.add(gkStationTypeEvents);
    }

    /**
     * 修改工位类型事件信息
     * @param gkStationTypeEvents  修改信息
     * @return
     */
    @PostMapping("/edit")
    @ResponseBody
    @Log(title = "工位类型事件",businessType = BusinessType.INSERT)
    public AjaxResult edit(@RequestBody GkStationTypeEvent gkStationTypeEvents){
        return gkStationTypeEventService.edit(gkStationTypeEvents);
    }

    /**
     * 删除工位类型事件信息
     * @param ids  工位类型事件id列表
     * @return
     */
    @DeleteMapping("/{ids}")
    @ResponseBody
    @Log(title = "工位类型事件",businessType = BusinessType.DELETE)
    public AjaxResult removeByIds(@PathVariable("ids") Long[] ids){
        return gkStationTypeEventService.removeByIds(ids);
    }

}
